const mongoose = require('mongoose')
// 创建一个约束对象
const advSchema = mongoose.Schema({
    advTitle : {
        type:String,
        required:true,//是否必填
    },
    advType : {
        type:Number,
        required:true,
    },
   advOrder:{
        type:Number,
        required:true
    },
   advHref:{
        type:String,
        required:true,
    },
    //添加时间
    addTime:{
        type:String,
        required:true,
        default:new Date().toLocaleString()
    },
    //更新时间
    upTime: {
        type: String,
        required: true,
        default: "--"
    }
})


// 根据约束对象创造集合
const advModel = mongoose.model("advList",advSchema)

module.exports = advModel;